home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PRINTER
/
DJPRINT.ARJ
/
DJPRINT.ASC
next >
Wrap
Text File
|
1992-03-25
|
9KB
|
181 lines
Geneva, March 25th 1992.
Djprint is a small utility your paper account will
be grateful for. If you own a HP Deskjet printer you will
be able to print on both sides of a sheet of paper and
thus squeeze 4 pages of text on a single sheet. The
printer is set in landscape mode and uses the standard 20
cpi courier font. Each side is divided in two 108-column
wide pages. The left and right pages are separated by a
vertical line. In addition, you have many options like
margins setting, headers and footers, line numbering,
line truncation or wrap-around, and frames.
Djprint is invoked on the command line with the
following syntax:
djprint [/t] [/pn] [/TABnn]
[/TMnn] [/BMnn] [/LMnn] [/RMnn]
[/LH="string"] [/RH="string"] [/BH="string"]
[/LF="string"] [/RF="string"] [/BF="string"]
[/MH="string"] [/MF="string"]
[/AN | /RN]
[/BR1 | /BR2 | /BR3 /BR4]
[@paramfile]
{filename} [>lpt1|outputfile]
The switches between square brackets are optional.
The output is sent onto the screen by default and must be
redirected to the printer for real printing.
/t stands for line truncation. Lines longer than 108
characters are truncated. By default, they are continued
on the next line without truncation.
/pn, where n is equal to 2 or 4, specifies the number of
pages per sheet, default is 4. So, if /p2 is selected
then only one side of the sheet is printed. If /p is
missing then both sides are used;
/TABnn allows to select the number of spaces TABs are
expanded in, default is 8; besides TABs, form feed
characters (ASCII 12) are interpreted as expected; other
control characters may have unpredictable effects, so
check that you print only text files (or at least pass
them though a filter, for example an AWK script, before
submitting them to Djprint).
[/TMnn] sets the top margin to nn lines, ie nn lines are
skipped before the first line of text gets printed;
default is 0;
[/BMnn] sets the bottom margin, ie nn lines are left
blank at the bottom of both pages; default is 0;
[/LMnn] sets the left margin to nn characters, ie nn
spaces are printed before the first character of each
line; default is 0;
[/RMnn] sets the right margin to nn characters, ie nn
spaces are reserved at the end of each line; default is
0;
The above margin settings apply to each side of the
sheet.
[/LH="string"] sets the left page header to "string";
[/RH="string"] sets the right page header to "string";
[/BH="string"] sets both the left and right page headers
to the same string "string";
[/LF="string"] sets the left page footer to "string";
[/RF="string"] sets the right page footer to "string";
[/BF="string"] sets both the left and right page footers
to the same string "string";
[/MH="string"] sets the main header to "string"; this
header, if present, is the first line of text printed and
applies to both side's pages;
[/MF="string"] sets the main footer to "string"; this
footer, if present, is the last line of text printed and
applies to both side's pages;
Unlike the main header and main footer, the above left
and right headers and footers apply to their respective
page on each side;
Do not forget to bracket the strings between two double
quotes or else the parser will return strange things !
[/AN | /RN] allow line numbering and are exclusive. If
/AN is selected an absolute line numbering is performed,
ie the lines are sequentially numbered from 1 to the last
file's line. If /RN is given a relative line numbering is
performed, ie the lines are sequentially numbered from 1
to the last line of the page and the counter is reset to
1 at the beginning of the next page. This allows to index
a line in a file by respectively its absolute number or
its page number and its relative line number.
[/BR1 | /BR2 | /BR3 /BR4] sets the sheets' border (frame)
type, by default there is no border around the printed
text.
/BR1 sets the border to a single line frame;
/BR2 sets the border to a double line frame;
/BR3 sets the border to a single horizontal line and
double vertical line frame;
/BR4 sets the border to a double horizontal line and a
single vertical line frame.
[@paramfile] tells the parser to look in file paramfile
for its parameters. This is needed because the command
line length is limited to 128 characters which is quickly
reached when multiple headers/footers and/or files are
given. The command line is still parsed for other
options, which may override the ones in the command file.
See below for a description of this file's format.
{filename} is a list of files to print, wildcards are
accepted. The file names follow the standard DOS
convention (ie, [drive:][path]filename[.extension]).
[>lptn|outputfile] redirects the output to the printer
port n or to a disk file. By default output is sent to
the screen.
Switches may be entered in either upper or lower
cases and in whatever order you want. When no parameters
are given Djprint displays a help screen with a summary
of all the options above. When exclusive parameters are
given many times or the same switches are used with
different parameters the most recent ones are effective
and override the previous ones. In order to keep the
parsing simple no error messages are displayed and
invalid switches are ignored.
If /p4 is given the printing is performed in two
passes, the first one prints pages 1 and 2, 5 and 6, 9
and 10, and so on. The second pass prints pages 3 and 4,
7 and 8, 11 and 12, and so on. Between the passes, the
stack of printed paper must be put again in the paper
tray WITHOUT changing its order (ie, the printed sides
up) and after the printer has emptied its buffer. Djprint
displays an appropriate message when the first pass has
completed. If the pages are to be bound together like in
a book, it is suggested to rotate (but not turn over) the
stack 180 degrees. This will allow to read the pages
without one wrenching his neck. As /p4 interacts with the
user, output should be redirected to the printer (>lptx
or prn) otherwise, if you print the redirection file
later, you will not be warned about the second pass. So
remember, you should use /p2 if you redirect the output
to a disk file. If you use /p4 the output should be
redirected to the printer.
If you have Buerg's List utility, you can experiment
with Djprint in the following way. Type:
djprint [your options and file names] | list/s.
This will pipe Djprint's output to List which will then
let you browse through it on the screen. When you are
satisfied with the parameters you can redirect the output
to the printer.
The optional command file has the following format:
each parameter must be given on a line of its own,
without '/' switch. For example:
djprint @cmdfile >prn
where cmdfile contains the lines below:
mh="Project SOCKETS"
mf="Winter 91-92"
an
tm3
*.mod *.def *.c
*.txt *.doc
This is functionnally equivalent to:
djprint /mh="Project SOCKETS" /mf="Winter 91-92" /an
/tm3 *.mod *.def *.c *.txt *.doc >prn
but is much easier to edit. Note how the options on the
command line are preceded by a '/' but not in the command
file.
As of today I've printed about 300 pages of text
with this program but, according to Murphy's laws, bugs
are certainly still sitting around waiting for that
large, essential document to mess up in the most critical
time. So, if you find one bug or want some new feature
added send me a mail at the address below.
This program was written in Logitech Modula-2 under
MS-DOS (but should be ported very easily to OS/2,
provided that OS/2 has the driver for the Deskjet
printer...) as a by-product of a university CS project.
As such it may need some refurbishment for example a
better user interface, a table of content when multiple
files are printed at once, matrix printers support,
better parsing, etc... Nonetheless, I would very much
appreciate a not so symbolic donation of 10$ to encourage
any further improvement. However, if you can't afford it,
it's all right, enjoy it anyway !
Cesare Cervini
29, avenue Dumas
CH-1206 Geneva
Switzerland
BIX: ccesare
Internet: cervini@eldi.epfl.ch